﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CapaNegocio;
using CapaDeEntidades;

namespace Biblioteca
{
    public partial class RegistrarPrestamo : System.Web.UI.Page
    {
        Controladora controladora = new Controladora();
        private Socio socio
        {
            get { return controladora.GetSocio(Idsocio); }
        }
        private int Idsocio 
            {
            get {return Convert.ToInt16(Request.QueryString["idSocio"]) ; }
            }
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            InicializarCabecera();
        }

        private void InicializarCabecera()
        {
            this.lblNumeroSocio.Text =socio.Codigo.ToString();
            this.lblNombre.Text = socio.NombreApellido;

        }
        protected void lnkVolver(object sender, EventArgs e)
        {
            Response.Redirect("Principal.aspx?idSocio= "+ Idsocio);
        }

        protected void btnBuscarLibro_OnClick(object sender, EventArgs e)
        {
            dtLibros.DataSource = controladora.GetLibroByTitulo(this.txtBuscarLibro.Text);
            dtLibros.DataBind();
            dtLibros.Visible = true;
        }

        protected void butGuardar_Click(object sender, EventArgs e)
        {
           
        }





    }
}
